package com.wyx.suanfa;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class rightSideView {

}


/*
* class Solution {
    public List<Integer> rightSideView(TreeNode root) {
        //该集合用于存放结果集
        List<Integer> list = new ArrayList<>();
        //该队列用于存放每层的节点
        Queue<TreeNode> que = new LinkedList<>();
        if(root == null){
         return list;
        }

        //先将根节点压入队列
        que.offer(root);
        while(!que.isEmpty()){
            int len = que.size();

            for(int i = 0;i<len;i++){
                TreeNode temp = que.poll();

                if(temp.left != null){
                    que.offer(temp.left);
                }
                if(temp.right != null){
                    que.offer(temp.right);
                }

                if(i == len - 1){
                    list.add(temp.val);
                }
            }
        }

        return list;
    }
}*/

